OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "content/renderer/render_frame_impl.h" | 5 #include "content/renderer/render_frame_impl.h" |
6 | 6 |
7 #include <map> | 7 #include <map> |
8 #include <string> | 8 #include <string> |
9 | 9 |
10 #include "base/auto_reset.h" | 10 #include "base/auto_reset.h" |
(...skipping 2023 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2034 blink::WebCookieJar* RenderFrameImpl::cookieJar(blink::WebLocalFrame* frame) { | 2034 blink::WebCookieJar* RenderFrameImpl::cookieJar(blink::WebLocalFrame* frame) { |
2035 DCHECK(!frame_ || frame_ == frame); | 2035 DCHECK(!frame_ || frame_ == frame); |
2036 return &cookie_jar_; | 2036 return &cookie_jar_; |
2037 } | 2037 } |
2038 | 2038 |
2039 blink::WebServiceWorkerProvider* RenderFrameImpl::createServiceWorkerProvider( | 2039 blink::WebServiceWorkerProvider* RenderFrameImpl::createServiceWorkerProvider( |
2040 blink::WebLocalFrame* frame) { | 2040 blink::WebLocalFrame* frame) { |
2041 DCHECK(!frame_ || frame_ == frame); | 2041 DCHECK(!frame_ || frame_ == frame); |
2042 // At this point we should have non-null data source. | 2042 // At this point we should have non-null data source. |
2043 DCHECK(frame->dataSource()); | 2043 DCHECK(frame->dataSource()); |
2044 if (!ChildThread::current()) | 2044 if (!ChildThreadImpl::current()) |
2045 return NULL; // May be null in some tests. | 2045 return NULL; // May be null in some tests. |
2046 ServiceWorkerNetworkProvider* provider = | 2046 ServiceWorkerNetworkProvider* provider = |
2047 ServiceWorkerNetworkProvider::FromDocumentState( | 2047 ServiceWorkerNetworkProvider::FromDocumentState( |
2048 DocumentState::FromDataSource(frame->dataSource())); | 2048 DocumentState::FromDataSource(frame->dataSource())); |
2049 return new WebServiceWorkerProviderImpl( | 2049 return new WebServiceWorkerProviderImpl( |
2050 ChildThread::current()->thread_safe_sender(), | 2050 ChildThreadImpl::current()->thread_safe_sender(), |
2051 provider ? provider->context() : NULL); | 2051 provider ? provider->context() : NULL); |
2052 } | 2052 } |
2053 | 2053 |
2054 void RenderFrameImpl::didAccessInitialDocument(blink::WebLocalFrame* frame) { | 2054 void RenderFrameImpl::didAccessInitialDocument(blink::WebLocalFrame* frame) { |
2055 DCHECK(!frame_ || frame_ == frame); | 2055 DCHECK(!frame_ || frame_ == frame); |
2056 // If the request hasn't yet committed, notify the browser process that it is | 2056 // If the request hasn't yet committed, notify the browser process that it is |
2057 // no longer safe to show the pending URL of the main frame, since a URL spoof | 2057 // no longer safe to show the pending URL of the main frame, since a URL spoof |
2058 // is now possible. (If the request has committed, the browser already knows.) | 2058 // is now possible. (If the request has committed, the browser already knows.) |
2059 if (!frame->parent()) { | 2059 if (!frame->parent()) { |
2060 DocumentState* document_state = | 2060 DocumentState* document_state = |
(...skipping 1294 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3355 blink::WebStorageQuotaType type, | 3355 blink::WebStorageQuotaType type, |
3356 unsigned long long requested_size, | 3356 unsigned long long requested_size, |
3357 blink::WebStorageQuotaCallbacks callbacks) { | 3357 blink::WebStorageQuotaCallbacks callbacks) { |
3358 DCHECK(!frame_ || frame_ == frame); | 3358 DCHECK(!frame_ || frame_ == frame); |
3359 WebSecurityOrigin origin = frame->document().securityOrigin(); | 3359 WebSecurityOrigin origin = frame->document().securityOrigin(); |
3360 if (origin.isUnique()) { | 3360 if (origin.isUnique()) { |
3361 // Unique origins cannot store persistent state. | 3361 // Unique origins cannot store persistent state. |
3362 callbacks.didFail(blink::WebStorageQuotaErrorAbort); | 3362 callbacks.didFail(blink::WebStorageQuotaErrorAbort); |
3363 return; | 3363 return; |
3364 } | 3364 } |
3365 ChildThread::current()->quota_dispatcher()->RequestStorageQuota( | 3365 ChildThreadImpl::current()->quota_dispatcher()->RequestStorageQuota( |
3366 render_view_->GetRoutingID(), | 3366 render_view_->GetRoutingID(), |
3367 GURL(origin.toString()), | 3367 GURL(origin.toString()), |
3368 static_cast<storage::StorageType>(type), | 3368 static_cast<storage::StorageType>(type), |
3369 requested_size, | 3369 requested_size, |
3370 QuotaDispatcher::CreateWebStorageQuotaCallbacksWrapper(callbacks)); | 3370 QuotaDispatcher::CreateWebStorageQuotaCallbacksWrapper(callbacks)); |
3371 } | 3371 } |
3372 | 3372 |
3373 void RenderFrameImpl::willOpenWebSocket(blink::WebSocketHandle* handle) { | 3373 void RenderFrameImpl::willOpenWebSocket(blink::WebSocketHandle* handle) { |
3374 WebSocketBridge* impl = static_cast<WebSocketBridge*>(handle); | 3374 WebSocketBridge* impl = static_cast<WebSocketBridge*>(handle); |
3375 impl->set_render_frame_id(routing_id_); | 3375 impl->set_render_frame_id(routing_id_); |
(...skipping 1101 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4477 | 4477 |
4478 #if defined(ENABLE_BROWSER_CDMS) | 4478 #if defined(ENABLE_BROWSER_CDMS) |
4479 RendererCdmManager* RenderFrameImpl::GetCdmManager() { | 4479 RendererCdmManager* RenderFrameImpl::GetCdmManager() { |
4480 if (!cdm_manager_) | 4480 if (!cdm_manager_) |
4481 cdm_manager_ = new RendererCdmManager(this); | 4481 cdm_manager_ = new RendererCdmManager(this); |
4482 return cdm_manager_; | 4482 return cdm_manager_; |
4483 } | 4483 } |
4484 #endif // defined(ENABLE_BROWSER_CDMS) | 4484 #endif // defined(ENABLE_BROWSER_CDMS) |
4485 | 4485 |
4486 } // namespace content | 4486 } // namespace content |
OLD | NEW |