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 "content/browser/appcache/view_appcache_internals_job.h" | 5 #include "content/browser/appcache/view_appcache_internals_job.h" |
6 | 6 |
7 #include <algorithm> | 7 #include <algorithm> |
8 #include <string> | 8 #include <string> |
9 | 9 |
10 #include "base/base64.h" | 10 #include "base/base64.h" |
(...skipping 634 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
645 | 645 |
646 if (command == kRemoveCacheCommand) | 646 if (command == kRemoveCacheCommand) |
647 return new RemoveAppCacheJob(request, network_delegate, service, | 647 return new RemoveAppCacheJob(request, network_delegate, service, |
648 DecodeBase64URL(param)); | 648 DecodeBase64URL(param)); |
649 | 649 |
650 if (command == kViewCacheCommand) | 650 if (command == kViewCacheCommand) |
651 return new ViewAppCacheJob(request, network_delegate, service, | 651 return new ViewAppCacheJob(request, network_delegate, service, |
652 DecodeBase64URL(param)); | 652 DecodeBase64URL(param)); |
653 | 653 |
654 std::vector<std::string> tokens; | 654 std::vector<std::string> tokens; |
655 int64 response_id; | 655 int64 response_id = 0; |
656 int64 group_id; | 656 int64 group_id = 0; |
657 if (command == kViewEntryCommand && Tokenize(param, "|", &tokens) == 4u && | 657 if (command == kViewEntryCommand && Tokenize(param, "|", &tokens) == 4u && |
658 base::StringToInt64(tokens[2], &response_id) && | 658 base::StringToInt64(tokens[2], &response_id) && |
659 base::StringToInt64(tokens[3], &group_id)) { | 659 base::StringToInt64(tokens[3], &group_id)) { |
660 return new ViewEntryJob(request, network_delegate, service, | 660 return new ViewEntryJob(request, network_delegate, service, |
661 DecodeBase64URL(tokens[0]), // manifest url | 661 DecodeBase64URL(tokens[0]), // manifest url |
662 DecodeBase64URL(tokens[1]), // entry url | 662 DecodeBase64URL(tokens[1]), // entry url |
663 response_id, group_id); | 663 response_id, group_id); |
664 } | 664 } |
665 | 665 |
666 return new RedirectToMainPageJob(request, network_delegate, service); | 666 return new RedirectToMainPageJob(request, network_delegate, service); |
667 } | 667 } |
668 | 668 |
669 } // namespace content | 669 } // namespace content |
OLD | NEW |