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

Side by Side Diff: net/url_request/sdch_dictionary_fetcher.cc

Issue 2849263003: Network traffic annotation added to SDCH Dictionary Fetcher. (Closed)
Patch Set: Created 3 years, 7 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 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 "net/url_request/sdch_dictionary_fetcher.h" 5 #include "net/url_request/sdch_dictionary_fetcher.h"
6 6
7 #include <stdint.h> 7 #include <stdint.h>
8 #include <queue> 8 #include <queue>
9 #include <set> 9 #include <set>
10 10
11 #include "base/auto_reset.h" 11 #include "base/auto_reset.h"
12 #include "base/bind.h" 12 #include "base/bind.h"
13 #include "base/compiler_specific.h" 13 #include "base/compiler_specific.h"
14 #include "base/macros.h" 14 #include "base/macros.h"
15 #include "base/threading/thread_task_runner_handle.h" 15 #include "base/threading/thread_task_runner_handle.h"
16 #include "net/base/io_buffer.h" 16 #include "net/base/io_buffer.h"
17 #include "net/base/load_flags.h" 17 #include "net/base/load_flags.h"
18 #include "net/base/sdch_net_log_params.h" 18 #include "net/base/sdch_net_log_params.h"
19 #include "net/http/http_response_headers.h" 19 #include "net/http/http_response_headers.h"
20 #include "net/log/net_log_event_type.h" 20 #include "net/log/net_log_event_type.h"
21 #include "net/log/net_log_with_source.h" 21 #include "net/log/net_log_with_source.h"
22 #include "net/traffic_annotation/network_traffic_annotation.h"
22 #include "net/url_request/redirect_info.h" 23 #include "net/url_request/redirect_info.h"
23 #include "net/url_request/url_request_context.h" 24 #include "net/url_request/url_request_context.h"
24 #include "net/url_request/url_request_status.h" 25 #include "net/url_request/url_request_status.h"
25 #include "net/url_request/url_request_throttler_manager.h" 26 #include "net/url_request/url_request_throttler_manager.h"
26 27
27 namespace net { 28 namespace net {
28 29
29 namespace { 30 namespace {
30 31
31 const int kBufferSize = 4096; 32 const int kBufferSize = 4096;
(...skipping 239 matching lines...) Expand 10 before | Expand all | Expand 10 after
271 if (fetch_queue_->IsEmpty() || current_request_.get()) { 272 if (fetch_queue_->IsEmpty() || current_request_.get()) {
272 next_state_ = STATE_NONE; 273 next_state_ = STATE_NONE;
273 return OK; 274 return OK;
274 } 275 }
275 276
276 next_state_ = STATE_SEND_REQUEST_PENDING; 277 next_state_ = STATE_SEND_REQUEST_PENDING;
277 278
278 FetchInfo info; 279 FetchInfo info;
279 bool success = fetch_queue_->Pop(&info); 280 bool success = fetch_queue_->Pop(&info);
280 DCHECK(success); 281 DCHECK(success);
281 current_request_ = context_->CreateRequest(info.url, IDLE, this); 282 net::NetworkTrafficAnnotationTag traffic_annotation =
283 net::DefineNetworkTrafficAnnotation("...", R"(
Randy Smith (Not in Mondays) 2017/05/02 15:37:36 I believe from reading the proto and definitions t
Ramin Halavati 2017/05/03 05:55:40 Done.
284 semantics {
285 sender: "..."
Randy Smith (Not in Mondays) 2017/05/02 15:37:35 So this is tricky and I'm not sure what to do here
Ramin Halavati 2017/05/03 05:55:40 Thank you very much for description, but sender he
Randy Smith (Not in Mondays) 2017/05/03 12:58:42 That's fine.
Ramin Halavati 2017/05/04 04:36:28 Done.
286 description: "..."
Randy Smith (Not in Mondays) 2017/05/02 15:37:35 The Chrome Network Stack can use less bandwidth an
Ramin Halavati 2017/05/03 05:55:40 Done.
287 trigger: "..."
Randy Smith (Not in Mondays) 2017/05/02 15:37:36 A response to a previous URL request indicated tha
Ramin Halavati 2017/05/03 05:55:40 Done.
288 data: "..."
Randy Smith (Not in Mondays) 2017/05/02 15:37:36 The server is sending a dictionary of common 'phra
Ramin Halavati 2017/05/03 05:55:40 This field should refer to data that this request
Randy Smith (Not in Mondays) 2017/05/03 12:58:42 Ah, sorry, data sent to the server. Yes, the URL
289 destination: WEBSITE/GOOGLE_OWNED_SERVICE/OTHER/LOCAL
Randy Smith (Not in Mondays) 2017/05/02 15:37:36 I think WEBSITE is the right answer here, but not
Ramin Halavati 2017/05/03 05:55:40 So my understanding is Google has no role in compr
Randy Smith (Not in Mondays) 2017/05/03 12:58:42 Google is one of the websites that has used SDCH,
Ramin Halavati 2017/05/04 04:36:28 Thank you.
290 }
291 policy {
292 cookies_allowed: false
293 setting: "..."
Randy Smith (Not in Mondays) 2017/05/02 15:37:36 Disabled in chrome. Can only be enabled in non-Ch
Ramin Halavati 2017/05/03 05:55:40 Done.
294 chrome_policy {
295 [POLICY_NAME] {
296 policy_options {mode: MANDATORY/RECOMMENDED/UNSET}
297 [POLICY_NAME]: ... //(value to disable it)
298 }
299 }
300 policy_exception_justification: "..."
301 })");
302 current_request_ =
303 context_->CreateRequest(info.url, IDLE, this, traffic_annotation);
282 int load_flags = LOAD_DO_NOT_SEND_COOKIES | LOAD_DO_NOT_SAVE_COOKIES; 304 int load_flags = LOAD_DO_NOT_SEND_COOKIES | LOAD_DO_NOT_SAVE_COOKIES;
283 if (info.cache_only) 305 if (info.cache_only)
284 load_flags |= LOAD_ONLY_FROM_CACHE | LOAD_SKIP_CACHE_VALIDATION; 306 load_flags |= LOAD_ONLY_FROM_CACHE | LOAD_SKIP_CACHE_VALIDATION;
285 current_request_->SetLoadFlags(load_flags); 307 current_request_->SetLoadFlags(load_flags);
286 308
287 buffer_ = new IOBuffer(kBufferSize); 309 buffer_ = new IOBuffer(kBufferSize);
288 dictionary_.reset(new std::string()); 310 dictionary_.reset(new std::string());
289 current_callback_ = info.callback; 311 current_callback_ = info.callback;
290 312
291 current_request_->Start(); 313 current_request_->Start();
(...skipping 76 matching lines...) Expand 10 before | Expand all | Expand 10 after
368 current_request_->net_log(), 390 current_request_->net_log(),
369 current_request_->was_cached()); 391 current_request_->was_cached());
370 } 392 }
371 393
372 ResetRequest(); 394 ResetRequest();
373 next_state_ = STATE_SEND_REQUEST; 395 next_state_ = STATE_SEND_REQUEST;
374 return OK; 396 return OK;
375 } 397 }
376 398
377 } // namespace net 399 } // namespace net
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