summaryrefslogtreecommitdiffstats
path: root/chrome
diff options
context:
space:
mode:
authorjorlow@chromium.org <jorlow@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-02-02 21:14:21 +0000
committerjorlow@chromium.org <jorlow@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-02-02 21:14:21 +0000
commitabdd08582e7840759ea7d6fc2beb64cdddae4c70 (patch)
tree03721167c38ccbc5a7dfdc4009c86ea0462999ac /chrome
parentf932d3cfd564146516b5718bb92390f9f2843503 (diff)
downloadchromium_src-abdd08582e7840759ea7d6fc2beb64cdddae4c70.zip
chromium_src-abdd08582e7840759ea7d6fc2beb64cdddae4c70.tar.gz
chromium_src-abdd08582e7840759ea7d6fc2beb64cdddae4c70.tar.bz2
Merge 37856
git-svn-id: svn://svn.chromium.org/chrome/branches/249/src@37875 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome')
-rw-r--r--chrome/browser/in_process_webkit/dom_storage_area.cc85
-rw-r--r--chrome/browser/in_process_webkit/dom_storage_area.h17
-rw-r--r--chrome/browser/in_process_webkit/dom_storage_dispatcher_host.cc43
-rw-r--r--chrome/browser/in_process_webkit/dom_storage_dispatcher_host.h16
-rw-r--r--chrome/browser/in_process_webkit/dom_storage_namespace.cc9
-rw-r--r--chrome/browser/in_process_webkit/dom_storage_namespace.h7
-rw-r--r--chrome/browser/in_process_webkit/dom_storage_permission_request.cc35
-rw-r--r--chrome/browser/in_process_webkit/dom_storage_permission_request.h56
-rw-r--r--chrome/browser/net/chrome_url_request_context.h2
-rw-r--r--chrome/browser/renderer_host/resource_message_filter.cc4
-rw-r--r--chrome/browser/renderer_host/resource_message_filter.h11
-rwxr-xr-xchrome/chrome.gyp2
12 files changed, 246 insertions, 41 deletions
diff --git a/chrome/browser/in_process_webkit/dom_storage_area.cc b/chrome/browser/in_process_webkit/dom_storage_area.cc
index d55adb9..879cc1b 100644
--- a/chrome/browser/in_process_webkit/dom_storage_area.cc
+++ b/chrome/browser/in_process_webkit/dom_storage_area.cc
@@ -1,57 +1,93 @@
-// Copyright (c) 2009 The Chromium Authors. All rights reserved. Use of this
+// Copyright (c) 2010 The Chromium Authors. All rights reserved. Use of this
// source code is governed by a BSD-style license that can be found in the
// LICENSE file.
#include "chrome/browser/in_process_webkit/dom_storage_area.h"
+#include "base/file_path.h"
+#include "base/file_util.h"
+#include "base/task.h"
+#include "chrome/browser/chrome_thread.h"
+#include "chrome/browser/in_process_webkit/dom_storage_context.h"
#include "chrome/browser/in_process_webkit/dom_storage_dispatcher_host.h"
#include "chrome/browser/in_process_webkit/dom_storage_namespace.h"
+#include "chrome/browser/in_process_webkit/dom_storage_permission_request.h"
+#include "chrome/browser/host_content_settings_map.h"
+#include "googleurl/src/gurl.h"
+#include "third_party/WebKit/WebKit/chromium/public/WebSecurityOrigin.h"
#include "third_party/WebKit/WebKit/chromium/public/WebStorageArea.h"
#include "third_party/WebKit/WebKit/chromium/public/WebString.h"
#include "third_party/WebKit/WebKit/chromium/public/WebURL.h"
+#include "webkit/glue/webkit_glue.h"
+using WebKit::WebSecurityOrigin;
using WebKit::WebStorageArea;
using WebKit::WebURL;
-DOMStorageArea::DOMStorageArea(const string16& origin,
- int64 id,
- DOMStorageNamespace* owner)
+DOMStorageArea::DOMStorageArea(
+ const string16& origin,
+ int64 id,
+ DOMStorageNamespace* owner,
+ HostContentSettingsMap* host_content_settings_map)
: origin_(origin),
id_(id),
- owner_(owner) {
+ owner_(owner),
+ host_content_settings_map_(host_content_settings_map),
+ host_(GURL(origin).host()) {
DCHECK(owner_);
+ DCHECK(host_content_settings_map_);
}
DOMStorageArea::~DOMStorageArea() {
}
unsigned DOMStorageArea::Length() {
+ if (!CheckContentSetting())
+ return 0; // Pretend we're an empty store.
+
CreateWebStorageAreaIfNecessary();
return storage_area_->length();
}
NullableString16 DOMStorageArea::Key(unsigned index) {
+ if (!CheckContentSetting())
+ return NullableString16(true); // Null string.
+
CreateWebStorageAreaIfNecessary();
return storage_area_->key(index);
}
NullableString16 DOMStorageArea::GetItem(const string16& key) {
+ if (!CheckContentSetting())
+ return NullableString16(true); // Null string.
+
CreateWebStorageAreaIfNecessary();
return storage_area_->getItem(key);
}
void DOMStorageArea::SetItem(const string16& key, const string16& value,
bool* quota_exception) {
+ if (!CheckContentSetting()) {
+ *quota_exception = true;
+ return NullableString16(true); // Ignored if exception is true.
+ }
+
CreateWebStorageAreaIfNecessary();
storage_area_->setItem(key, value, WebURL(), *quota_exception);
}
void DOMStorageArea::RemoveItem(const string16& key) {
+ if (!CheckContentSetting())
+ return NullableString16(true); // Indicates nothing removed.
+
CreateWebStorageAreaIfNecessary();
storage_area_->removeItem(key, WebURL());
}
void DOMStorageArea::Clear() {
+ if (!CheckContentSetting())
+ return false; // Nothing cleared.
+
CreateWebStorageAreaIfNecessary();
storage_area_->clear(WebURL());
}
@@ -64,3 +100,42 @@ void DOMStorageArea::CreateWebStorageAreaIfNecessary() {
if (!storage_area_.get())
storage_area_.reset(owner_->CreateWebStorageArea(origin_));
}
+
+bool DOMStorageArea::CheckContentSetting() {
+ ContentSetting content_setting =
+ host_content_settings_map_->GetContentSetting(
+ host_, CONTENT_SETTINGS_TYPE_COOKIES);
+
+ if (content_setting == CONTENT_SETTING_ASK) {
+ WebSecurityOrigin security_origin(
+ WebSecurityOrigin::createFromString(origin_));
+ FilePath::StringType file_name = webkit_glue::WebStringToFilePath(
+ security_origin.databaseIdentifier()).value();
+ file_name.append(DOMStorageContext::kLocalStorageExtension);
+ FilePath file_path = webkit_glue::WebStringToFilePath(
+ owner_->data_dir_path()).Append(file_name);
+
+ bool file_exists = false;
+ int64 size = 0;
+ base::Time last_modified;
+ file_util::FileInfo file_info;
+ if (file_util::GetFileInfo(file_path, &file_info)) {
+ file_exists = true;
+ size = file_info.size;
+ last_modified = file_info.last_modified;
+ }
+ DOMStoragePermissionRequest request(host_, file_exists, size,
+ last_modified);
+ // TODO(jorlow/darin): Do something useful instead of calling DoSomething.
+ ChromeThread::PostTask(
+ ChromeThread::UI, FROM_HERE,
+ NewRunnableFunction(&DOMStoragePermissionRequest::DoSomething,
+ &request));
+ content_setting = request.WaitOnResponse();
+ }
+
+ if (content_setting == CONTENT_SETTING_ALLOW)
+ return true;
+ DCHECK(content_setting == CONTENT_SETTING_BLOCK);
+ return false;
+}
diff --git a/chrome/browser/in_process_webkit/dom_storage_area.h b/chrome/browser/in_process_webkit/dom_storage_area.h
index 218aaf4..a9f1aa8 100644
--- a/chrome/browser/in_process_webkit/dom_storage_area.h
+++ b/chrome/browser/in_process_webkit/dom_storage_area.h
@@ -1,15 +1,19 @@
-// Copyright (c) 2009 The Chromium Authors. All rights reserved. Use of this
+// Copyright (c) 2010 The Chromium Authors. All rights reserved. Use of this
// source code is governed by a BSD-style license that can be found in the
// LICENSE file.
#ifndef CHROME_BROWSER_IN_PROCESS_WEBKIT_DOM_STORAGE_AREA_H_
#define CHROME_BROWSER_IN_PROCESS_WEBKIT_DOM_STORAGE_AREA_H_
+#include <string>
+
#include "base/hash_tables.h"
#include "base/nullable_string16.h"
+#include "base/ref_counted.h"
#include "base/scoped_ptr.h"
class DOMStorageNamespace;
+class HostContentSettingsMap;
namespace WebKit {
class WebStorageArea;
@@ -19,7 +23,10 @@ class WebStorageArea;
// with DOMStorageContext.
class DOMStorageArea {
public:
- DOMStorageArea(const string16& origin, int64 id, DOMStorageNamespace* owner);
+ DOMStorageArea(const string16& origin,
+ int64 id,
+ DOMStorageNamespace* owner,
+ HostContentSettingsMap* host_content_settings_map);
~DOMStorageArea();
unsigned Length();
@@ -30,6 +37,7 @@ class DOMStorageArea {
void RemoveItem(const string16& key);
void Clear();
void PurgeMemory();
+ bool CheckContentSetting();
int64 id() const { return id_; }
@@ -49,6 +57,11 @@ class DOMStorageArea {
// The DOMStorageNamespace that owns us.
DOMStorageNamespace* owner_;
+ scoped_refptr<HostContentSettingsMap> host_content_settings_map_;
+
+ // The host portion of the origin_.
+ const std::string host_;
+
DISALLOW_IMPLICIT_CONSTRUCTORS(DOMStorageArea);
};
diff --git a/chrome/browser/in_process_webkit/dom_storage_dispatcher_host.cc b/chrome/browser/in_process_webkit/dom_storage_dispatcher_host.cc
index 28005b4..e3badb9 100644
--- a/chrome/browser/in_process_webkit/dom_storage_dispatcher_host.cc
+++ b/chrome/browser/in_process_webkit/dom_storage_dispatcher_host.cc
@@ -1,4 +1,4 @@
-// Copyright (c) 2009 The Chromium Authors. All rights reserved. Use of this
+// Copyright (c) 2010 The Chromium Authors. All rights reserved. Use of this
// source code is governed by a BSD-style license that can be found in the
// LICENSE file.
@@ -10,7 +10,9 @@
#include "chrome/browser/in_process_webkit/dom_storage_context.h"
#include "chrome/browser/in_process_webkit/dom_storage_namespace.h"
#include "chrome/browser/in_process_webkit/webkit_thread.h"
+#include "chrome/browser/net/chrome_url_request_context.h"
#include "chrome/browser/renderer_host/browser_render_process_host.h"
+#include "chrome/browser/renderer_host/resource_message_filter.h"
#include "chrome/common/render_messages.h"
#include "googleurl/src/gurl.h"
@@ -39,23 +41,25 @@ ScopedStorageEventContext::~ScopedStorageEventContext() {
}
DOMStorageDispatcherHost::DOMStorageDispatcherHost(
- IPC::Message::Sender* message_sender, WebKitContext* webkit_context,
+ ResourceMessageFilter* resource_message_filter,
+ WebKitContext* webkit_context,
WebKitThread* webkit_thread)
: webkit_context_(webkit_context),
webkit_thread_(webkit_thread),
- message_sender_(message_sender),
+ resource_message_filter_(resource_message_filter),
process_handle_(0) {
DCHECK(webkit_context_.get());
DCHECK(webkit_thread_);
- DCHECK(message_sender_);
+ DCHECK(resource_message_filter_);
}
DOMStorageDispatcherHost::~DOMStorageDispatcherHost() {
}
-void DOMStorageDispatcherHost::Init(base::ProcessHandle process_handle) {
+void DOMStorageDispatcherHost::Init(
+ base::ProcessHandle process_handle) {
DCHECK(ChromeThread::CurrentlyOn(ChromeThread::IO));
- DCHECK(message_sender_); // Make sure Shutdown() has not yet been called.
+ DCHECK(resource_message_filter_); // Ensure Shutdown() has not been called.
DCHECK(!process_handle_); // Make sure Init() has not yet been called.
DCHECK(process_handle);
Context()->RegisterDispatcherHost(this);
@@ -66,7 +70,7 @@ void DOMStorageDispatcherHost::Shutdown() {
if (ChromeThread::CurrentlyOn(ChromeThread::IO)) {
if (process_handle_) // Init() was called
Context()->UnregisterDispatcherHost(this);
- message_sender_ = NULL;
+ resource_message_filter_ = NULL;
// The task will only execute if the WebKit thread is already running.
ChromeThread::PostTask(
@@ -76,7 +80,7 @@ void DOMStorageDispatcherHost::Shutdown() {
}
DCHECK(ChromeThread::CurrentlyOn(ChromeThread::WEBKIT));
- DCHECK(!message_sender_);
+ DCHECK(!resource_message_filter_);
// TODO(jorlow): Do stuff that needs to be run on the WebKit thread. Locks
// and others will likely need this, so let's not delete this
@@ -130,13 +134,13 @@ bool DOMStorageDispatcherHost::OnMessageReceived(const IPC::Message& message,
}
void DOMStorageDispatcherHost::Send(IPC::Message* message) {
- if (!message_sender_) {
+ if (!resource_message_filter_) {
delete message;
return;
}
if (ChromeThread::CurrentlyOn(ChromeThread::IO)) {
- message_sender_->Send(message);
+ resource_message_filter_->Send(message);
return;
}
@@ -194,13 +198,17 @@ void DOMStorageDispatcherHost::OnCloneNamespaceId(int64 namespace_id,
void DOMStorageDispatcherHost::OnStorageAreaId(int64 namespace_id,
const string16& origin,
IPC::Message* reply_msg) {
- if (ChromeThread::CurrentlyOn(ChromeThread::IO)) {
- ChromeThread::PostTask(ChromeThread::WEBKIT, FROM_HERE, NewRunnableMethod(
- this, &DOMStorageDispatcherHost::OnStorageAreaId, namespace_id, origin,
- reply_msg));
- return;
- }
+ DCHECK(ChromeThread::CurrentlyOn(ChromeThread::IO));
+ ChromeURLRequestContext* url_request_context =
+ resource_message_filter_->GetRequestContextForURL(GURL(origin));
+ ChromeThread::PostTask(ChromeThread::WEBKIT, FROM_HERE, NewRunnableMethod(
+ this, &DOMStorageDispatcherHost::OnStorageAreaIdWebKit, namespace_id,
+ origin, reply_msg, url_request_context->host_content_settings_map()));
+}
+void DOMStorageDispatcherHost::OnStorageAreaIdWebKit(
+ int64 namespace_id, const string16& origin, IPC::Message* reply_msg,
+ HostContentSettingsMap* host_content_settings_map) {
DCHECK(ChromeThread::CurrentlyOn(ChromeThread::WEBKIT));
DOMStorageNamespace* storage_namespace =
Context()->GetStorageNamespace(namespace_id);
@@ -210,7 +218,8 @@ void DOMStorageDispatcherHost::OnStorageAreaId(int64 namespace_id,
delete reply_msg;
return;
}
- DOMStorageArea* storage_area = storage_namespace->GetStorageArea(origin);
+ DOMStorageArea* storage_area = storage_namespace->GetStorageArea(
+ origin, host_content_settings_map);
ViewHostMsg_DOMStorageCloneNamespaceId::WriteReplyParams(reply_msg,
storage_area->id());
Send(reply_msg);
diff --git a/chrome/browser/in_process_webkit/dom_storage_dispatcher_host.h b/chrome/browser/in_process_webkit/dom_storage_dispatcher_host.h
index 029a122..217c040 100644
--- a/chrome/browser/in_process_webkit/dom_storage_dispatcher_host.h
+++ b/chrome/browser/in_process_webkit/dom_storage_dispatcher_host.h
@@ -1,4 +1,4 @@
-// Copyright (c) 2009 The Chromium Authors. All rights reserved. Use of this
+// Copyright (c) 2010 The Chromium Authors. All rights reserved. Use of this
// source code is governed by a BSD-style license that can be found in the
// LICENSE file.
@@ -15,6 +15,8 @@
class DOMStorageContext;
class GURL;
+class HostContentSettingsMap;
+class ResourceMessageFilter;
class Task;
class WebKitThread;
struct ViewMsg_DOMStorageEvent_Params;
@@ -26,7 +28,8 @@ class DOMStorageDispatcherHost
: public base::RefCountedThreadSafe<DOMStorageDispatcherHost> {
public:
// Only call the constructor from the UI thread.
- DOMStorageDispatcherHost(IPC::Message::Sender* message_sender,
+ DOMStorageDispatcherHost(
+ ResourceMessageFilter* resource_message_filter_,
WebKitContext* webkit_context, WebKitThread* webkit_thread);
// Only call from ResourceMessageFilter on the IO thread.
@@ -68,6 +71,11 @@ class DOMStorageDispatcherHost
const GURL& url);
void OnClear(int64 storage_area_id, const GURL& url);
+ // WebKit thread half of OnStorageAreaId
+ void OnStorageAreaIdWebKit(
+ int64 namespace_id, const string16& origin, IPC::Message* reply_msg,
+ HostContentSettingsMap* host_context_settings_map);
+
// Only call on the IO thread.
void OnStorageEvent(const ViewMsg_DOMStorageEvent_Params& params);
@@ -94,8 +102,8 @@ class DOMStorageDispatcherHost
// ResourceDispatcherHost takes care of destruction. Immutable.
WebKitThread* webkit_thread_;
- // Only set on the IO thread.
- IPC::Message::Sender* message_sender_;
+ // Only set and use on the IO thread.
+ ResourceMessageFilter* resource_message_filter_;
// If we get a corrupt message from a renderer, we need to kill it using this
// handle.
diff --git a/chrome/browser/in_process_webkit/dom_storage_namespace.cc b/chrome/browser/in_process_webkit/dom_storage_namespace.cc
index f6e9ae5..eb973d0 100644
--- a/chrome/browser/in_process_webkit/dom_storage_namespace.cc
+++ b/chrome/browser/in_process_webkit/dom_storage_namespace.cc
@@ -1,4 +1,4 @@
-// Copyright (c) 2009 The Chromium Authors. All rights reserved. Use of this
+// Copyright (c) 2010 The Chromium Authors. All rights reserved. Use of this
// source code is governed by a BSD-style license that can be found in the
// LICENSE file.
@@ -56,7 +56,9 @@ DOMStorageNamespace::~DOMStorageNamespace() {
}
}
-DOMStorageArea* DOMStorageNamespace::GetStorageArea(const string16& origin) {
+DOMStorageArea* DOMStorageNamespace::GetStorageArea(
+ const string16& origin,
+ HostContentSettingsMap* host_content_settings_map) {
// We may have already created it for another dispatcher host.
OriginToStorageAreaMap::iterator iter = origin_to_storage_area_.find(origin);
if (iter != origin_to_storage_area_.end())
@@ -65,7 +67,8 @@ DOMStorageArea* DOMStorageNamespace::GetStorageArea(const string16& origin) {
// We need to create a new one.
int64 id = dom_storage_context_->AllocateStorageAreaId();
DCHECK(!dom_storage_context_->GetStorageArea(id));
- DOMStorageArea* storage_area = new DOMStorageArea(origin, id, this);
+ DOMStorageArea* storage_area = new DOMStorageArea(origin, id, this,
+ host_content_settings_map);
origin_to_storage_area_[origin] = storage_area;
dom_storage_context_->RegisterStorageArea(storage_area);
return storage_area;
diff --git a/chrome/browser/in_process_webkit/dom_storage_namespace.h b/chrome/browser/in_process_webkit/dom_storage_namespace.h
index a41dcd7..b2c9a45 100644
--- a/chrome/browser/in_process_webkit/dom_storage_namespace.h
+++ b/chrome/browser/in_process_webkit/dom_storage_namespace.h
@@ -1,4 +1,4 @@
-// Copyright (c) 2009 The Chromium Authors. All rights reserved. Use of this
+// Copyright (c) 2010 The Chromium Authors. All rights reserved. Use of this
// source code is governed by a BSD-style license that can be found in the
// LICENSE file.
@@ -14,6 +14,7 @@
class DOMStorageArea;
class DOMStorageContext;
class FilePath;
+class HostContentSettingsMap;
namespace WebKit {
class WebStorageArea;
@@ -30,7 +31,8 @@ class DOMStorageNamespace {
~DOMStorageNamespace();
- DOMStorageArea* GetStorageArea(const string16& origin);
+ DOMStorageArea* GetStorageArea(const string16& origin,
+ HostContentSettingsMap* map);
DOMStorageNamespace* Copy();
void PurgeMemory();
@@ -38,6 +40,7 @@ class DOMStorageNamespace {
return dom_storage_context_;
}
int64 id() const { return id_; }
+ const WebKit::WebString& data_dir_path() const { return data_dir_path_; }
DOMStorageType dom_storage_type() const { return dom_storage_type_; }
// Creates a WebStorageArea for the given origin. This should only be called
diff --git a/chrome/browser/in_process_webkit/dom_storage_permission_request.cc b/chrome/browser/in_process_webkit/dom_storage_permission_request.cc
new file mode 100644
index 0000000..05635aa
--- /dev/null
+++ b/chrome/browser/in_process_webkit/dom_storage_permission_request.cc
@@ -0,0 +1,35 @@
+// Copyright (c) 2010 The Chromium Authors. All rights reserved. Use of this
+// source code is governed by a BSD-style license that can be found in the
+// LICENSE file.
+
+#include "chrome/browser/in_process_webkit/dom_storage_permission_request.h"
+
+DOMStoragePermissionRequest::DOMStoragePermissionRequest(
+ const std::string& host,
+ bool file_exists,
+ int64 size,
+ const base::Time last_modified)
+ : host_(host),
+ file_exists_(file_exists),
+ size_(size),
+ last_modified_(last_modified),
+ event_(true, false) { // manual reset, not initially signaled
+}
+
+ContentSetting DOMStoragePermissionRequest::WaitOnResponse() {
+ event_.Wait();
+ return response_content_setting_;
+}
+
+void DOMStoragePermissionRequest::SendResponse(ContentSetting content_setting) {
+ response_content_setting_ = content_setting;
+ event_.Signal();
+}
+
+// static
+void DOMStoragePermissionRequest::DoSomething(
+ DOMStoragePermissionRequest *dom_storage_permission_request) {
+ // TODO(jorlow/darin): This function is just a placeholder until we work out
+ // exactly what needs to happen here.
+ dom_storage_permission_request->SendResponse(CONTENT_SETTING_BLOCK);
+}
diff --git a/chrome/browser/in_process_webkit/dom_storage_permission_request.h b/chrome/browser/in_process_webkit/dom_storage_permission_request.h
new file mode 100644
index 0000000..362cf52
--- /dev/null
+++ b/chrome/browser/in_process_webkit/dom_storage_permission_request.h
@@ -0,0 +1,56 @@
+// Copyright (c) 2010 The Chromium Authors. All rights reserved. Use of this
+// source code is governed by a BSD-style license that can be found in the
+// LICENSE file.
+
+#ifndef CHROME_BROWSER_IN_PROCESS_WEBKIT_DOM_STORAGE_PERMISSION_REQUEST_H_
+#define CHROME_BROWSER_IN_PROCESS_WEBKIT_DOM_STORAGE_PERMISSION_REQUEST_H_
+
+#include <string>
+
+#include "base/time.h"
+#include "base/waitable_event.h"
+#include "chrome/common/content_settings.h"
+
+// This class is used to request content setting related permission for local
+// storage. It should only be used for one such event and then discarded.
+class DOMStoragePermissionRequest {
+ public:
+ DOMStoragePermissionRequest(const std::string& host,
+ bool file_exists_,
+ int64 size,
+ const base::Time last_modified);
+
+ ContentSetting WaitOnResponse();
+ void SendResponse(ContentSetting content_setting);
+
+ const std::string& host() const { return host_; }
+ bool file_exists() const { return file_exists_; }
+ int64 size() const { return size_; }
+ const base::Time last_modified() const { return last_modified_; }
+
+ // Just an example.
+ static void DoSomething(DOMStoragePermissionRequest *request);
+
+ private:
+ // The host we need to get permission for.
+ const std::string host_;
+
+ // Is there any information on disk currently?
+ bool file_exists_;
+
+ // If file_exists_, what's the size?
+ int64 size_;
+
+ // If file_exists_, what's the size?
+ const base::Time last_modified_;
+
+ // The response to the permission request.
+ ContentSetting response_content_setting_;
+
+ // One time use. Never reset.
+ base::WaitableEvent event_;
+
+ DISALLOW_IMPLICIT_CONSTRUCTORS(DOMStoragePermissionRequest);
+};
+
+#endif // CHROME_BROWSER_IN_PROCESS_WEBKIT_DOM_STORAGE_PERMISSION_REQUEST_H_
diff --git a/chrome/browser/net/chrome_url_request_context.h b/chrome/browser/net/chrome_url_request_context.h
index cefec74..b1b85c0 100644
--- a/chrome/browser/net/chrome_url_request_context.h
+++ b/chrome/browser/net/chrome_url_request_context.h
@@ -190,7 +190,7 @@ class ChromeURLRequestContext : public URLRequestContext,
virtual bool AllowSendingCookies(const URLRequest* request) const;
- const HostContentSettingsMap* host_content_settings_map() const {
+ HostContentSettingsMap* host_content_settings_map() {
return host_content_settings_map_;
}
diff --git a/chrome/browser/renderer_host/resource_message_filter.cc b/chrome/browser/renderer_host/resource_message_filter.cc
index be71601..675647f 100644
--- a/chrome/browser/renderer_host/resource_message_filter.cc
+++ b/chrome/browser/renderer_host/resource_message_filter.cc
@@ -997,9 +997,9 @@ Clipboard* ResourceMessageFilter::GetClipboard() {
return clipboard;
}
-ChromeURLRequestContext*
-ResourceMessageFilter::GetRequestContextForURL(
+ChromeURLRequestContext* ResourceMessageFilter::GetRequestContextForURL(
const GURL& url) {
+ DCHECK(ChromeThread::CurrentlyOn(ChromeThread::IO));
URLRequestContextGetter* context_getter =
url.SchemeIs(chrome::kExtensionScheme) ?
extensions_request_context_ : request_context_;
diff --git a/chrome/browser/renderer_host/resource_message_filter.h b/chrome/browser/renderer_host/resource_message_filter.h
index cfcff68..547bc86 100644
--- a/chrome/browser/renderer_host/resource_message_filter.h
+++ b/chrome/browser/renderer_host/resource_message_filter.h
@@ -1,4 +1,4 @@
-// Copyright (c) 2009 The Chromium Authors. All rights reserved.
+// Copyright (c) 2010 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
@@ -117,6 +117,11 @@ class ResourceMessageFilter : public IPC::ChannelProxy::MessageFilter,
const NotificationSource& source,
const NotificationDetails& details);
+ // Returns either the extension URLRequestContext or regular URLRequestContext
+ // depending on whether |url| is an extension URL.
+ // Only call on the IO thread.
+ ChromeURLRequestContext* GetRequestContextForURL(const GURL& url);
+
private:
friend class ChromeThread;
friend class DeleteTask<ResourceMessageFilter>;
@@ -330,10 +335,6 @@ class ResourceMessageFilter : public IPC::ChannelProxy::MessageFilter,
// thread.
static Clipboard* GetClipboard();
- // Returns either the extension URLRequestContext or regular URLRequestContext
- // depending on whether |url| is an extension URL.
- ChromeURLRequestContext* GetRequestContextForURL(const GURL& url);
-
NotificationRegistrar registrar_;
// The channel associated with the renderer connection. This pointer is not
diff --git a/chrome/chrome.gyp b/chrome/chrome.gyp
index 7d48b6b..664c26a 100755
--- a/chrome/chrome.gyp
+++ b/chrome/chrome.gyp
@@ -1796,6 +1796,8 @@
'browser/in_process_webkit/dom_storage_dispatcher_host.h',
'browser/in_process_webkit/dom_storage_namespace.cc',
'browser/in_process_webkit/dom_storage_namespace.h',
+ 'browser/in_process_webkit/dom_storage_permission_request.cc',
+ 'browser/in_process_webkit/dom_storage_permission_request.h',
'browser/in_process_webkit/webkit_context.cc',
'browser/in_process_webkit/webkit_context.h',
'browser/in_process_webkit/webkit_thread.cc',