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

Side by Side Diff: content/browser/devtools/protocol/service_worker_handler.cc

Issue 1233633002: Initialize render_frame_host_ in the constuctor of ServiceWorkerHandler. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 5 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 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 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/browser/devtools/protocol/service_worker_handler.h" 5 #include "content/browser/devtools/protocol/service_worker_handler.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/containers/scoped_ptr_hash_map.h" 8 #include "base/containers/scoped_ptr_hash_map.h"
9 #include "base/strings/string_number_conversions.h" 9 #include "base/strings/string_number_conversions.h"
10 #include "base/strings/utf_string_conversions.h" 10 #include "base/strings/utf_string_conversions.h"
(...skipping 212 matching lines...) Expand 10 before | Expand all | Expand 10 after
223 case DevToolsAgentHost::TYPE_BROWSER: 223 case DevToolsAgentHost::TYPE_BROWSER:
224 return "browser"; 224 return "browser";
225 } 225 }
226 NOTREACHED() << type; 226 NOTREACHED() << type;
227 return std::string(); 227 return std::string();
228 } 228 }
229 229
230 } // namespace 230 } // namespace
231 231
232 ServiceWorkerHandler::ServiceWorkerHandler() 232 ServiceWorkerHandler::ServiceWorkerHandler()
233 : enabled_(false), weak_factory_(this) { 233 : enabled_(false), render_frame_host_(nullptr), weak_factory_(this) {
234 } 234 }
235 235
236 ServiceWorkerHandler::~ServiceWorkerHandler() { 236 ServiceWorkerHandler::~ServiceWorkerHandler() {
237 Disable(); 237 Disable();
238 } 238 }
239 239
240 void ServiceWorkerHandler::SetRenderFrameHost( 240 void ServiceWorkerHandler::SetRenderFrameHost(
241 RenderFrameHostImpl* render_frame_host) { 241 RenderFrameHostImpl* render_frame_host) {
242 render_frame_host_ = render_frame_host; 242 render_frame_host_ = render_frame_host;
243 // Do not call UpdateHosts yet, wait for load to commit. 243 // Do not call UpdateHosts yet, wait for load to commit.
(...skipping 344 matching lines...) Expand 10 before | Expand all | Expand 10 after
588 return; 588 return;
589 host->DetachClient(); 589 host->DetachClient();
590 client_->WorkerTerminated(WorkerTerminatedParams::Create()-> 590 client_->WorkerTerminated(WorkerTerminatedParams::Create()->
591 set_worker_id(host->GetId())); 591 set_worker_id(host->GetId()));
592 attached_hosts_.erase(it); 592 attached_hosts_.erase(it);
593 } 593 }
594 594
595 } // namespace service_worker 595 } // namespace service_worker
596 } // namespace devtools 596 } // namespace devtools
597 } // namespace content 597 } // 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