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

Side by Side Diff: content/browser/service_worker/service_worker_client_utils.cc

Issue 2912593003: [ServiceWorker] Fix bugs of wpt tests for Client.navigate (Closed)
Patch Set: Address comments from falken@ Created 3 years, 6 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 | third_party/WebKit/LayoutTests/TestExpectations » ('j') | 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/service_worker/service_worker_client_utils.h" 5 #include "content/browser/service_worker/service_worker_client_utils.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 #include <tuple> 8 #include <tuple>
9 9
10 #include "base/location.h" 10 #include "base/location.h"
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after
52 public: 52 public:
53 OpenURLObserver(WebContents* web_contents, 53 OpenURLObserver(WebContents* web_contents,
54 int frame_tree_node_id, 54 int frame_tree_node_id,
55 const OpenURLCallback& callback) 55 const OpenURLCallback& callback)
56 : WebContentsObserver(web_contents), 56 : WebContentsObserver(web_contents),
57 frame_tree_node_id_(frame_tree_node_id), 57 frame_tree_node_id_(frame_tree_node_id),
58 callback_(callback) {} 58 callback_(callback) {}
59 59
60 void DidFinishNavigation(NavigationHandle* navigation_handle) override { 60 void DidFinishNavigation(NavigationHandle* navigation_handle) override {
61 DCHECK(web_contents()); 61 DCHECK(web_contents());
62 if (!navigation_handle->HasCommitted()) 62 if (!navigation_handle->HasCommitted()) {
63 // Return error.
64 RunCallback(ChildProcessHost::kInvalidUniqueID, MSG_ROUTING_NONE);
63 return; 65 return;
66 }
64 67
65 if (navigation_handle->GetFrameTreeNodeId() != frame_tree_node_id_) 68 if (navigation_handle->GetFrameTreeNodeId() != frame_tree_node_id_) {
69 // Return error.
70 RunCallback(ChildProcessHost::kInvalidUniqueID, MSG_ROUTING_NONE);
66 return; 71 return;
72 }
67 73
68 RenderFrameHost* render_frame_host = 74 RenderFrameHost* render_frame_host =
69 navigation_handle->GetRenderFrameHost(); 75 navigation_handle->GetRenderFrameHost();
70 RunCallback(render_frame_host->GetProcess()->GetID(), 76 RunCallback(render_frame_host->GetProcess()->GetID(),
71 render_frame_host->GetRoutingID()); 77 render_frame_host->GetRoutingID());
72 } 78 }
73 79
74 void RenderProcessGone(base::TerminationStatus status) override { 80 void RenderProcessGone(base::TerminationStatus status) override {
75 RunCallback(ChildProcessHost::kInvalidUniqueID, MSG_ROUTING_NONE); 81 RunCallback(ChildProcessHost::kInvalidUniqueID, MSG_ROUTING_NONE);
76 } 82 }
(...skipping 459 matching lines...) Expand 10 before | Expand all | Expand 10 after
536 options.client_type == blink::kWebServiceWorkerClientTypeAll) { 542 options.client_type == blink::kWebServiceWorkerClientTypeAll) {
537 GetWindowClients(controller, options, callback, std::move(clients)); 543 GetWindowClients(controller, options, callback, std::move(clients));
538 return; 544 return;
539 } 545 }
540 546
541 GetNonWindowClients(controller, options, callback, std::move(clients)); 547 GetNonWindowClients(controller, options, callback, std::move(clients));
542 } 548 }
543 549
544 } // namespace service_worker_client_utils 550 } // namespace service_worker_client_utils
545 } // namespace content 551 } // namespace content
OLDNEW
« no previous file with comments | « no previous file | third_party/WebKit/LayoutTests/TestExpectations » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698