Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(83)

Side by Side Diff: content/renderer/render_frame_impl.cc

Issue 609283002: [ServiceWorker] Fix RenderFrameImpl::isControlledByServiceWorker() (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 3163 matching lines...) Expand 10 before | Expand all | Expand 10 after
3174 blink::WebScreenOrientationClient* 3174 blink::WebScreenOrientationClient*
3175 RenderFrameImpl::webScreenOrientationClient() { 3175 RenderFrameImpl::webScreenOrientationClient() {
3176 if (!screen_orientation_dispatcher_) 3176 if (!screen_orientation_dispatcher_)
3177 screen_orientation_dispatcher_ = new ScreenOrientationDispatcher(this); 3177 screen_orientation_dispatcher_ = new ScreenOrientationDispatcher(this);
3178 return screen_orientation_dispatcher_; 3178 return screen_orientation_dispatcher_;
3179 } 3179 }
3180 3180
3181 bool RenderFrameImpl::isControlledByServiceWorker() { 3181 bool RenderFrameImpl::isControlledByServiceWorker() {
3182 // If we're in the middle of committing a load, the data source we need 3182 // If we're in the middle of committing a load, the data source we need
3183 // will still be provisional. 3183 // will still be provisional.
3184 WebFrame* main_frame = render_view_->webview()->mainFrame(); 3184 if (!frame_)
3185 return false;
Mike West 2014/09/30 06:17:31 Can this ever be false?
horo 2014/09/30 06:55:59 DCHECK(frame_) seems be better.
3185 WebDataSource* data_source = NULL; 3186 WebDataSource* data_source = NULL;
3186 if (main_frame->provisionalDataSource()) 3187 if (frame_->provisionalDataSource())
3187 data_source = main_frame->provisionalDataSource(); 3188 data_source = frame_->provisionalDataSource();
3188 else 3189 else
3189 data_source = main_frame->dataSource(); 3190 data_source = frame_->dataSource();
3190 ServiceWorkerNetworkProvider* provider = 3191 ServiceWorkerNetworkProvider* provider =
3191 ServiceWorkerNetworkProvider::FromDocumentState( 3192 ServiceWorkerNetworkProvider::FromDocumentState(
3192 DocumentState::FromDataSource(data_source)); 3193 DocumentState::FromDataSource(data_source));
3193 return provider->context()->controller_handle_id() != 3194 return provider->context()->controller_handle_id() !=
3194 kInvalidServiceWorkerHandleId; 3195 kInvalidServiceWorkerHandleId;
3195 } 3196 }
3196 3197
3197 void RenderFrameImpl::postAccessibilityEvent(const blink::WebAXObject& obj, 3198 void RenderFrameImpl::postAccessibilityEvent(const blink::WebAXObject& obj,
3198 blink::WebAXEvent event) { 3199 blink::WebAXEvent event) {
3199 HandleWebAccessibilityEvent(obj, event); 3200 HandleWebAccessibilityEvent(obj, event);
(...skipping 702 matching lines...) Expand 10 before | Expand all | Expand 10 after
3902 3903
3903 #if defined(ENABLE_BROWSER_CDMS) 3904 #if defined(ENABLE_BROWSER_CDMS)
3904 RendererCdmManager* RenderFrameImpl::GetCdmManager() { 3905 RendererCdmManager* RenderFrameImpl::GetCdmManager() {
3905 if (!cdm_manager_) 3906 if (!cdm_manager_)
3906 cdm_manager_ = new RendererCdmManager(this); 3907 cdm_manager_ = new RendererCdmManager(this);
3907 return cdm_manager_; 3908 return cdm_manager_;
3908 } 3909 }
3909 #endif // defined(ENABLE_BROWSER_CDMS) 3910 #endif // defined(ENABLE_BROWSER_CDMS)
3910 3911
3911 } // namespace content 3912 } // namespace content
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698