Changeset 56330 in webkit


Ignore:
Timestamp:
Mar 22, 2010 4:07:45 AM (14 years ago)
Author:
eric@webkit.org
Message:

2010-03-22 Jochen Eisinger <jochen@chromium.org>

Reviewed by Jeremy Orlow.

Added methods to WebSecurityOrigin for invoking
SecurityOrigin::canAccess and SecurityOrigin::Create
https://bugs.webkit.org/show_bug.cgi?id=36356

  • public/WebSecurityOrigin.h:
  • src/WebSecurityOrigin.cpp: (WebKit::WebSecurityOrigin::create): (WebKit::WebSecurityOrigin::canAccess):
Location:
trunk/WebKit/chromium
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/WebKit/chromium/ChangeLog

    r56303 r56330  
     12010-03-22  Jochen Eisinger  <jochen@chromium.org>
     2
     3        Reviewed by Jeremy Orlow.
     4
     5        Added methods to WebSecurityOrigin for invoking
     6        SecurityOrigin::canAccess and SecurityOrigin::Create
     7        https://bugs.webkit.org/show_bug.cgi?id=36356
     8
     9        * public/WebSecurityOrigin.h:
     10        * src/WebSecurityOrigin.cpp:
     11        (WebKit::WebSecurityOrigin::create):
     12        (WebKit::WebSecurityOrigin::canAccess):
     13
    1142010-03-20  Dimitri Glazkov  <dglazkov@chromium.org>
    215
  • trunk/WebKit/chromium/public/WebSecurityOrigin.h

    r54214 r56330  
    11/*
    2  * Copyright (C) 2009 Google Inc. All rights reserved.
     2 * Copyright (C) 2010 Google Inc. All rights reserved.
    33 *
    44 * Redistribution and use in source and binary forms, with or without
     
    4343class WebSecurityOriginPrivate;
    4444class WebString;
     45class WebURL;
    4546
    4647class WebSecurityOrigin {
     
    5960    WEBKIT_API static WebSecurityOrigin* createFromDatabaseIdentifier(const WebString& databaseIdentifier);
    6061    WEBKIT_API static WebSecurityOrigin createFromString(const WebString&);
     62    WEBKIT_API static WebSecurityOrigin create(const WebURL&);
    6163
    6264    WEBKIT_API void reset();
     
    7173    // The empty WebSecurityOrigin is the least privileged WebSecurityOrigin.
    7274    WEBKIT_API bool isEmpty() const;
     75
     76    // Returns true if this SecurityOrigin can script objects in the given
     77    // SecurityOrigin. For example, call this function before allowing
     78    // script from one security origin to read or write objects from
     79    // another SecurityOrigin.
     80    WEBKIT_API bool canAccess(const WebSecurityOrigin&) const;
    7381
    7482    // Returns a string representation of the WebSecurityOrigin.  The empty
  • trunk/WebKit/chromium/src/WebSecurityOrigin.cpp

    r54214 r56330  
    11/*
    2  * Copyright (C) 2009 Google Inc. All rights reserved.
     2 * Copyright (C) 2010 Google Inc. All rights reserved.
    33 *
    44 * Redistribution and use in source and binary forms, with or without
     
    3232#include "WebSecurityOrigin.h"
    3333
     34#include "KURL.h"
    3435#include "SecurityOrigin.h"
    3536#include "WebString.h"
     37#include "WebURL.h"
    3638#include <wtf/PassRefPtr.h>
    3739
     
    5153{
    5254    return WebSecurityOrigin(SecurityOrigin::createFromString(origin));
     55}
     56
     57WebSecurityOrigin WebSecurityOrigin::create(const WebURL& url)
     58{
     59    return WebSecurityOrigin(SecurityOrigin::create(url));
    5360}
    5461
     
    9097}
    9198
     99bool WebSecurityOrigin::canAccess(const WebSecurityOrigin& other) const
     100{
     101    ASSERT(m_private);
     102    ASSERT(other.m_private);
     103    return m_private->canAccess(other.m_private);
     104}
     105
    92106WebString WebSecurityOrigin::toString() const
    93107{
Note: See TracChangeset for help on using the changeset viewer.