OLD | NEW |
---|---|
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 "chrome/browser/devtools/devtools_ui_bindings.h" | 5 #include "chrome/browser/devtools/devtools_ui_bindings.h" |
6 | 6 |
7 #include "base/command_line.h" | 7 #include "base/command_line.h" |
8 #include "base/json/json_reader.h" | 8 #include "base/json/json_reader.h" |
9 #include "base/json/json_writer.h" | 9 #include "base/json/json_writer.h" |
10 #include "base/metrics/histogram.h" | 10 #include "base/metrics/histogram.h" |
(...skipping 572 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
583 int stream_id) { | 583 int stream_id) { |
584 GURL gurl(url); | 584 GURL gurl(url); |
585 if (!gurl.is_valid()) { | 585 if (!gurl.is_valid()) { |
586 base::DictionaryValue response; | 586 base::DictionaryValue response; |
587 response.SetInteger("statusCode", 404); | 587 response.SetInteger("statusCode", 404); |
588 callback.Run(&response); | 588 callback.Run(&response); |
589 return; | 589 return; |
590 } | 590 } |
591 | 591 |
592 net::URLFetcher* fetcher = | 592 net::URLFetcher* fetcher = |
593 net::URLFetcher::Create(gurl, net::URLFetcher::GET, this); | 593 net::URLFetcher::Create(gurl, net::URLFetcher::GET, this).release(); |
Ryan Sleevi
2015/04/30 18:23:44
maybe move this .release() to 594
| |
594 pending_requests_[fetcher] = callback; | 594 pending_requests_[fetcher] = callback; |
595 fetcher->SetRequestContext(profile_->GetRequestContext()); | 595 fetcher->SetRequestContext(profile_->GetRequestContext()); |
596 fetcher->SetExtraRequestHeaders(headers); | 596 fetcher->SetExtraRequestHeaders(headers); |
597 fetcher->SaveResponseWithWriter(scoped_ptr<net::URLFetcherResponseWriter>( | 597 fetcher->SaveResponseWithWriter(scoped_ptr<net::URLFetcherResponseWriter>( |
598 new ResponseWriter(weak_factory_.GetWeakPtr(), stream_id))); | 598 new ResponseWriter(weak_factory_.GetWeakPtr(), stream_id))); |
599 fetcher->Start(); | 599 fetcher->Start(); |
600 } | 600 } |
601 | 601 |
602 void DevToolsUIBindings::OpenInNewTab(const std::string& url) { | 602 void DevToolsUIBindings::OpenInNewTab(const std::string& url) { |
603 delegate_->OpenInNewTab(url); | 603 delegate_->OpenInNewTab(url); |
(...skipping 445 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1049 if (frontend_loaded_) | 1049 if (frontend_loaded_) |
1050 return; | 1050 return; |
1051 frontend_loaded_ = true; | 1051 frontend_loaded_ = true; |
1052 | 1052 |
1053 // Call delegate first - it seeds importants bit of information. | 1053 // Call delegate first - it seeds importants bit of information. |
1054 delegate_->OnLoadCompleted(); | 1054 delegate_->OnLoadCompleted(); |
1055 | 1055 |
1056 UpdateTheme(); | 1056 UpdateTheme(); |
1057 AddDevToolsExtensionsToClient(); | 1057 AddDevToolsExtensionsToClient(); |
1058 } | 1058 } |
OLD | NEW |