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

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

Issue 373873002: Fixes for re-enabling more MSVC level 4 warnings: content/browser/ edition (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 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 | Annotate | Revision Log
« no previous file with comments | « content/browser/renderer_host/p2p/socket_host.cc ('k') | 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 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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_internals_ui.h" 5 #include "content/browser/service_worker/service_worker_internals_ui.h"
6 6
7 #include <string> 7 #include <string>
8 #include <vector> 8 #include <vector>
9 9
10 #include "base/bind.h" 10 #include "base/bind.h"
(...skipping 542 matching lines...) Expand 10 before | Expand all | Expand 10 after
553 *context = static_cast<ServiceWorkerContextWrapper*>( 553 *context = static_cast<ServiceWorkerContextWrapper*>(
554 result_partition->GetServiceWorkerContext()); 554 result_partition->GetServiceWorkerContext());
555 return true; 555 return true;
556 } 556 }
557 557
558 void ServiceWorkerInternalsUI::CallServiceWorkerVersionMethod( 558 void ServiceWorkerInternalsUI::CallServiceWorkerVersionMethod(
559 ServiceWorkerVersionMethod method, 559 ServiceWorkerVersionMethod method,
560 const ListValue* args) { 560 const ListValue* args) {
561 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); 561 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
562 int callback_id; 562 int callback_id;
563 const DictionaryValue* cmd_args = NULL;
563 int partition_id; 564 int partition_id;
564 int64 version_id; 565 scoped_refptr<ServiceWorkerContextWrapper> context;
565 std::string version_id_string; 566 std::string version_id_string;
566 const DictionaryValue* cmd_args = NULL; 567 int64 version_id = 0;
567 scoped_refptr<ServiceWorkerContextWrapper> context;
568 if (!args->GetInteger(0, &callback_id) || 568 if (!args->GetInteger(0, &callback_id) ||
569 !args->GetDictionary(1, &cmd_args) || 569 !args->GetDictionary(1, &cmd_args) ||
570 !cmd_args->GetInteger("partition_id", &partition_id) || 570 !cmd_args->GetInteger("partition_id", &partition_id) ||
571 !GetServiceWorkerContext(partition_id, &context) || 571 !GetServiceWorkerContext(partition_id, &context) ||
572 !cmd_args->GetString("version_id", &version_id_string) || 572 !cmd_args->GetString("version_id", &version_id_string) ||
573 !base::StringToInt64(version_id_string, &version_id)) { 573 !base::StringToInt64(version_id_string, &version_id)) {
574 return; 574 return;
575 } 575 }
576 576
577 base::Callback<void(ServiceWorkerStatusCode)> callback = 577 base::Callback<void(ServiceWorkerStatusCode)> callback =
578 base::Bind(OperationCompleteCallback, AsWeakPtr(), callback_id); 578 base::Bind(OperationCompleteCallback, AsWeakPtr(), callback_id);
579 CallServiceWorkerVersionMethodWithVersionID( 579 CallServiceWorkerVersionMethodWithVersionID(
580 method, context, version_id, callback); 580 method, context, version_id, callback);
581 } 581 }
582 582
583 void ServiceWorkerInternalsUI::DispatchPushEvent( 583 void ServiceWorkerInternalsUI::DispatchPushEvent(
584 const ListValue* args) { 584 const ListValue* args) {
585 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); 585 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
586 int callback_id; 586 int callback_id;
587 int partition_id; 587 int partition_id;
588 int64 version_id; 588 int64 version_id = 0;
589 std::string version_id_string; 589 std::string version_id_string;
590 const DictionaryValue* cmd_args = NULL; 590 const DictionaryValue* cmd_args = NULL;
591 scoped_refptr<ServiceWorkerContextWrapper> context; 591 scoped_refptr<ServiceWorkerContextWrapper> context;
592 if (!args->GetInteger(0, &callback_id) || 592 if (!args->GetInteger(0, &callback_id) ||
593 !args->GetDictionary(1, &cmd_args) || 593 !args->GetDictionary(1, &cmd_args) ||
594 !cmd_args->GetInteger("partition_id", &partition_id) || 594 !cmd_args->GetInteger("partition_id", &partition_id) ||
595 !GetServiceWorkerContext(partition_id, &context) || 595 !GetServiceWorkerContext(partition_id, &context) ||
596 !cmd_args->GetString("version_id", &version_id_string) || 596 !cmd_args->GetString("version_id", &version_id_string) ||
597 !base::StringToInt64(version_id_string, &version_id)) { 597 !base::StringToInt64(version_id_string, &version_id)) {
598 return; 598 return;
599 } 599 }
600 600
601 base::Callback<void(ServiceWorkerStatusCode)> callback = 601 base::Callback<void(ServiceWorkerStatusCode)> callback =
602 base::Bind(OperationCompleteCallback, AsWeakPtr(), callback_id); 602 base::Bind(OperationCompleteCallback, AsWeakPtr(), callback_id);
603 DispatchPushEventWithVersionID(context, version_id, callback); 603 DispatchPushEventWithVersionID(context, version_id, callback);
604 } 604 }
605 605
606 void ServiceWorkerInternalsUI::InspectWorker(const ListValue* args) { 606 void ServiceWorkerInternalsUI::InspectWorker(const ListValue* args) {
607 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); 607 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
608 int callback_id; 608 int callback_id;
609 int process_id;
610 int devtools_agent_route_id;
611 const DictionaryValue* cmd_args = NULL; 609 const DictionaryValue* cmd_args = NULL;
612 scoped_refptr<ServiceWorkerContextWrapper> context; 610 int process_id = 0;
611 int devtools_agent_route_id = 0;
613 if (!args->GetInteger(0, &callback_id) || 612 if (!args->GetInteger(0, &callback_id) ||
614 !args->GetDictionary(1, &cmd_args) || 613 !args->GetDictionary(1, &cmd_args) ||
615 !cmd_args->GetInteger("process_id", &process_id) || 614 !cmd_args->GetInteger("process_id", &process_id) ||
616 !cmd_args->GetInteger("devtools_agent_route_id", 615 !cmd_args->GetInteger("devtools_agent_route_id",
617 &devtools_agent_route_id)) { 616 &devtools_agent_route_id)) {
618 return; 617 return;
619 } 618 }
620 base::Callback<void(ServiceWorkerStatusCode)> callback = 619 base::Callback<void(ServiceWorkerStatusCode)> callback =
621 base::Bind(OperationCompleteCallback, AsWeakPtr(), callback_id); 620 base::Bind(OperationCompleteCallback, AsWeakPtr(), callback_id);
622 scoped_refptr<DevToolsAgentHost> agent_host( 621 scoped_refptr<DevToolsAgentHost> agent_host(
(...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after
666 return; 665 return;
667 } 666 }
668 667
669 base::Callback<void(ServiceWorkerStatusCode)> callback = 668 base::Callback<void(ServiceWorkerStatusCode)> callback =
670 base::Bind(OperationCompleteCallback, AsWeakPtr(), callback_id); 669 base::Bind(OperationCompleteCallback, AsWeakPtr(), callback_id);
671 FindRegistrationForPattern( 670 FindRegistrationForPattern(
672 context, GURL(scope_string), base::Bind(StartActiveWorker, callback)); 671 context, GURL(scope_string), base::Bind(StartActiveWorker, callback));
673 } 672 }
674 673
675 } // namespace content 674 } // namespace content
OLDNEW
« no previous file with comments | « content/browser/renderer_host/p2p/socket_host.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698