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

Side by Side Diff: experimental/webtry/webtry.go

Issue 688003002: fix issues with simultaneous configs and security jail on skfiddle (Closed) Base URL: https://skia.googlesource.com/skia@master
Patch Set: Created 6 years, 1 month 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 | « experimental/webtry/main.cpp ('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 package main 1 package main
2 2
3 import ( 3 import (
4 "bytes" 4 "bytes"
5 "crypto/md5" 5 "crypto/md5"
6 "database/sql" 6 "database/sql"
7 "encoding/base64" 7 "encoding/base64"
8 "encoding/binary" 8 "encoding/binary"
9 "encoding/json" 9 "encoding/json"
10 "flag" 10 "flag"
(...skipping 930 matching lines...) Expand 10 before | Expand all | Expand 10 after
941 png, err := ioutil.ReadFile("../../../inout/" + hash + " _raster.png") 941 png, err := ioutil.ReadFile("../../../inout/" + hash + " _raster.png")
942 if err != nil { 942 if err != nil {
943 reportTryError(w, r, err, "Failed to open the ra ster-generated PNG.", hash) 943 reportTryError(w, r, err, "Failed to open the ra ster-generated PNG.", hash)
944 return 944 return
945 } 945 }
946 946
947 m.RasterImg = base64.StdEncoding.EncodeToString([]byte(p ng)) 947 m.RasterImg = base64.StdEncoding.EncodeToString([]byte(p ng))
948 } 948 }
949 949
950 if request.GPU { 950 if request.GPU {
951 » » » png, err := ioutil.ReadFile("../../../inout/" + hash + " _GPU.png") 951 » » » png, err := ioutil.ReadFile("../../../inout/" + hash + " _gpu.png")
952 if err != nil { 952 if err != nil {
953 reportTryError(w, r, err, "Failed to open the GP U-generated PNG.", hash) 953 reportTryError(w, r, err, "Failed to open the GP U-generated PNG.", hash)
954 return 954 return
955 } 955 }
956 956
957 m.GPUImg = base64.StdEncoding.EncodeToString([]byte(png) ) 957 m.GPUImg = base64.StdEncoding.EncodeToString([]byte(png) )
958 } 958 }
959 959
960 resp, err := json.Marshal(m) 960 resp, err := json.Marshal(m)
961 if err != nil { 961 if err != nil {
(...skipping 16 matching lines...) Expand all
978 http.HandleFunc("/sources/", autogzip.HandleFunc(sourcesHandler)) 978 http.HandleFunc("/sources/", autogzip.HandleFunc(sourcesHandler))
979 979
980 // Resources are served directly 980 // Resources are served directly
981 // TODO add support for caching/etags/gzip 981 // TODO add support for caching/etags/gzip
982 http.Handle("/res/", autogzip.Handle(http.FileServer(http.Dir("./")))) 982 http.Handle("/res/", autogzip.Handle(http.FileServer(http.Dir("./"))))
983 983
984 // TODO Break out /c/ as it's own handler. 984 // TODO Break out /c/ as it's own handler.
985 http.HandleFunc("/", autogzip.HandleFunc(mainHandler)) 985 http.HandleFunc("/", autogzip.HandleFunc(mainHandler))
986 glog.Fatal(http.ListenAndServe(*port, nil)) 986 glog.Fatal(http.ListenAndServe(*port, nil))
987 } 987 }
OLDNEW
« no previous file with comments | « experimental/webtry/main.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698